package com.acme.bankapp.domain.bank;

import java.util.ArrayList;
import java.util.List;


public class Bank {
	private static Bank instance;
	private List<Client> clients; // List of our clients. Not array, because in list we can dynamically add objects (in arrays too, but List is better for these objectives)
	
	private Bank(){
		this.clients = new ArrayList<Client>(); // Init out List of Client
	}
	
	public void addClient(Client cl){
		this.clients.add(cl); // Add new Client to Bank
	}
	
	public List<Client> getClients(){
		return this.clients; // Get list of Bank's clients
	}
	
	public int getClientsCount(){
		return clients.size(); // Get length of list (I have know idea how can I use it now :)). "just because I can"
	}
	
	public static Bank getInstance(){ // Singleton. I'm not sure that we need only 1 Bank.
		if (instance == null){
			instance = new Bank();
		}
		return instance;
	}
}
